local gps = require("nvim-gps")

local function gps_content()
	if gps.is_available() then
		return gps.get_location()
	else
		return "gps not available"
	end
end

require("lualine").setup({
	options = {
		icons_enabled = true,
		---@usage 'rose-pine' | 'rose-pine-alt'
		-- theme = 'rose-pine',
		theme = "catppuccin",
		component_separators = { left = "", right = "" },
		section_separators = { left = "", right = "" },
		disabled_filetypes = {},
		always_divide_middle = true,
	},
	sections = {
		lualine_a = { "mode" },
		-- lualine_b = {'branch', 'diff', 'diagnostics'},
		lualine_b = {
			{
				"diagnostics",
				sources = { "nvim_diagnostic" },
				symbols = { error = " ", warn = " ", info = " " },
			},
		},
		-- lualine_c = {'filename'},
		lualine_c = {
			{ gps_content, cond = gps.is_available },
		},

		lualine_x = {
			{
				"filetype",
				"encoding",
			},
			{
				"fileformat",
				icons_enabled = true,
				symbols = {
					unix = "LF",
					dos = "CRLF",
					mac = "CR",
				},
			},
		},
		lualine_y = { "branch" },
		lualine_z = { "progress", "location" },
	},
	inactive_sections = {
		lualine_a = {},
		lualine_b = {},
		lualine_c = { "filename" },

		lualine_x = { "location" },
		lualine_y = {},
		lualine_z = {},
	},
	tabline = {},
	extensions = {
		"aerial",
		"nvim-tree",
	},
})
